package me.android.library.common.ipc;

import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;


public class IpcClientHandler extends Handler {
    private static final String TAG = "IpcClientHandler";

    public IpcClientHandler() {
        super(Looper.getMainLooper());
    }

    @Override
    public void handleMessage(Message msg) {
        switch (msg.what) {
            case IpcService.MSG_COMMAND:
                int code = msg.getData().getInt("code");
                String message = msg.getData().getString("message");
                Bundle data = msg.getData().getBundle("data");
                Log.d(TAG, "收到回复: code=" + code + ", message=" + message);
                // 处理返回结果
                break;
            default:
                super.handleMessage(msg);
        }
    }
}
